package com.msb.common.exception;

import com.msb.common.enums.ExceptionEnums;
import lombok.Getter;

/**
 * @Author: lmf
 * @Create: 2025/3/8 16:49
 * Description:  api接口异常
 */
@Getter
public class ApiException extends RuntimeException{
    final private Integer code;

    public ApiException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public ApiException(ExceptionEnums exceptionEnums) {
        super(exceptionEnums.getMsg());
        this.code = exceptionEnums.getCode();
    }
}
